package com.xdf.wxbebarrel.service;

import com.xdf.wxbebarrel.dao.cloud.QrloginMapper;
import com.xdf.wxbebarrel.model.Qrlogin;
import com.xdf.wxbebarrel.model.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class QrloginServiceImpl implements QrloginService {

    @Autowired
    private QrloginMapper dao;

    @Override
    public Qrlogin insert(Qrlogin record) {
        int ret = dao.insertSelective(record);
        return record;
    }

    @Override
    public SysUser login(String openid,String guid) {
//        SysUser sysUser = sysUserService.selectByOpenid(openid);
//        if( sysUser == null ) return null;// 没有该用户则退出不继续
//
//        Qrlogin qrlogin = new Qrlogin();
//        qrlogin.setGuid(guid);
//        qrlogin.setOpenid(openid);
//        qrlogin.setLogin_name(sysUser.getLogin_name());
//        qrlogin.setUser_name(sysUser.getUser_name());
//        qrlogin.setSuccess(true);
//        int ret = dao.insertSelective(qrlogin);
//        return sysUser;
        return null;
    }
}
